const path = require('path');

module.exports = [
  {
    files: ['packages/**/*.ts', 'scripts/**/*.ts'],
    ignores: ['**/node_modules/**/*', '**/dist/**/*', '**/build/**/*'],
    languageOptions: {
      parserOptions: {
        ecmaVersion: 'latest',
        sourceType: 'module',
        project: path.resolve(__dirname, './tsconfig.json'),
      },
      parser: require('@typescript-eslint/parser'), // 确保使用 TypeScript 解析器
    },
    plugins: {
      '@typescript-eslint': require('@typescript-eslint/eslint-plugin'),
    },
    rules: {
      '@typescript-eslint/explicit-module-boundary-types': 'off',
      '@typescript-eslint/no-explicit-any': 'off',
      'no-console': 'warn',
      '@typescript-eslint/no-unused-vars': ['error'],
    },
    settings: {
      'import/resolver': {
        typescript: {
          project: path.resolve(__dirname, './tsconfig.json'),
        },
      },
    },
  },
];